/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.gis.eemc.service;

import java.lang.Boolean;
import java.util.List;

import net.gis.eemc.dao.FacultyDAO;
import net.gis.eemc.dao.FacultyDAOImpl;
import net.gis.eemc.domain.Faculty;

/**
 *
 * @author Sergey
 */
public class FacultyServiceImpl {

    FacultyDAO facDAO;

    public FacultyServiceImpl() {
        facDAO = new FacultyDAOImpl();
    }

    public Boolean isFacultyWithTitleExists(String Title) {
        List<Faculty> faculties;
        faculties = facDAO.getFacultyWithTitle(Title);
        return !faculties.isEmpty();
    }

    public Boolean isFacultyWithShortNameExists(String ShortName) {
        List<Faculty> faculties;
        faculties = facDAO.getFacultyWithShortName(ShortName);
        return !faculties.isEmpty();
    }

    public List<Faculty> getFaculties() {
        return facDAO.listFaculty();
    }

    public void update(Faculty fac) {
        facDAO.updateFaculty(fac);
    }
}
